package file;

import java.io.File;
import java.io.FileFilter;

public class ListFilesDemo2 {
    public static void main(String[] args) {
        File dir = new File(".");
        if (dir.isDirectory()) {
            FileFilter fileFilter = new FileFilter() {
                public boolean accept(File pathname) {
                    return pathname.getName().startsWith(".");
                }
            };
            File[] subs = dir.listFiles(fileFilter);
            for (File sub : subs) {
                System.out.println(sub);
            }
        }
    }
}
